package timbap.visualizer.api.context.messaging;

import timbap.visualizer.api.model.TimeCode;

/**
 * The <code>AbstractTimeCodeDispatcher</code> provides a base
 * implementation for all time code dispatching classes.
 *
 * @author  Andreas Pabst
 * @see timbap.visualizer.api.model.TimeCode
 * @see timbap.visualizer.api.context.messaging.AbstractTimeCodePublisher
 * @see timbap.visualizer.api.context.messaging.TimeCodeDispatcher
 */
public abstract class AbstractTimeCodeDispatcher extends AbstractTimeCodePublisher implements TimeCodeDispatcher {
    
	boolean hasTimeCode = false; 
	
    public AbstractTimeCodeDispatcher() {
        super();
    }
    
    public void timeCodeUpdated(TimeCode pTimeCode) {
    	if (!hasTimeCode) {
    		hasTimeCode = true;
    	}
        publishTimeCode(pTimeCode);
    }

	public boolean hasTimeCode() {
		return hasTimeCode;
	}

}
